#include <iostream>
#include <stdexcept>
using namespace std;
void example_p173(int i);
void example_p174();
void practice_5_23();
int main()
{
	//example_p173(-1);
	//example_p174();
	practice_5_23();
	return 0;
}
void example_p173(int i)
{
	if(i<0)
		throw std::runtime_error("i must >=0"); 
}
void example_p174()
{
	try{
		example_p173(-1);
	}
	catch(runtime_error err){
		cout<<"exception occurs:"<<endl;
		cout<<err.what()<<endl;
	}
}
void practice_5_23()
{
	int i,j;
	while(cin>>i>>j){
		try{
			if(j==0){
				throw runtime_error("/ by 0");
			}
			cout<<i/j<<endl;
			break;
		}
		catch(runtime_error err){
			cout<<err.what()<<"\n try again? Enter y or n"<<endl;
			char c;
			cin>>c;
			if(!cin||c=='n')
				break;
		}
	}
}